package com.ccys.cms.controller.userManagement;

import com.ccys.cms.service.userManagement.TblMemberAiaCorporateWebService;
import com.ccys.common.constants.ContextConstants;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.userManagement.TblMemberAiaCorporateDTO;
import com.ccys.db.vo.userManagement.TblMemberAiaCorporateWebVO;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@ApiIgnore
@RestController
@Api(tags = "用户管理-病人的aia记录，todo如何使用")
@RequestMapping("userManagement")
@CrossOrigin(methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE, RequestMethod.PUT}) // 开启跨域访问允许
@SuppressWarnings("unchecked")
public class MemberAiaCorporateWebController {

    @Autowired
    private TblMemberAiaCorporateWebService tblMemberAiaCorporateWebService;
    // 未确认需求  应该是app端使用的
    @GetMapping("memberAiaCorporate")
    @ApiOperation("获取列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "对象id", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间(格式 yyyy-mm-dd)", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间(格式 yyyy-mm-dd)", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "orderByStr", value = "排序字段（后端返回的字段  asc升序，desc 降序,加上end后缀。示例（createdOn降序排 则传值 createdOn descend））",paramType = "query"),
    })
    @ApiResponses({
            @ApiResponse(code = 411, message = ContextConstants.DESC_411),
            @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = TblMemberAiaCorporateWebVO.class)
    })
    public ResponseResult listObjectsCms(HttpServletRequest request, HttpServletResponse response, @ApiIgnore TblMemberAiaCorporateDTO dto) {
        return this.tblMemberAiaCorporateWebService.listObjectsCms(request, response, dto);
    }
}